<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>微信支付py | 눈_눈？</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/favicon.ico">
    <meta name="description" content="雨润三江水,一任五更寒">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    
    <link rel="preload" href="/assets/css/0.styles.39493abb.css" as="style"><link rel="preload" href="/assets/js/app.f4a44a18.js" as="script"><link rel="preload" href="/assets/js/3.48232c0c.js" as="script"><link rel="preload" href="/assets/js/1.1ffd113d.js" as="script"><link rel="preload" href="/assets/js/45.fafbd061.js" as="script"><link rel="prefetch" href="/assets/js/10.3ca9dec1.js"><link rel="prefetch" href="/assets/js/11.874c1055.js"><link rel="prefetch" href="/assets/js/12.ba64ad86.js"><link rel="prefetch" href="/assets/js/13.567f7e2c.js"><link rel="prefetch" href="/assets/js/14.a883120b.js"><link rel="prefetch" href="/assets/js/15.f0f48289.js"><link rel="prefetch" href="/assets/js/16.665ca6bd.js"><link rel="prefetch" href="/assets/js/17.9e5d8903.js"><link rel="prefetch" href="/assets/js/18.f72895dc.js"><link rel="prefetch" href="/assets/js/19.2a106cc2.js"><link rel="prefetch" href="/assets/js/20.4c0d7dc8.js"><link rel="prefetch" href="/assets/js/21.6771e3a2.js"><link rel="prefetch" href="/assets/js/22.f3c7aad6.js"><link rel="prefetch" href="/assets/js/23.60529100.js"><link rel="prefetch" href="/assets/js/24.7d50cb5e.js"><link rel="prefetch" href="/assets/js/25.58231492.js"><link rel="prefetch" href="/assets/js/26.3067a077.js"><link rel="prefetch" href="/assets/js/27.b167830e.js"><link rel="prefetch" href="/assets/js/28.f5722284.js"><link rel="prefetch" href="/assets/js/29.62d2e4fe.js"><link rel="prefetch" href="/assets/js/30.c2afa3b0.js"><link rel="prefetch" href="/assets/js/31.d7dde24d.js"><link rel="prefetch" href="/assets/js/32.4e2b272d.js"><link rel="prefetch" href="/assets/js/33.5e4d7960.js"><link rel="prefetch" href="/assets/js/34.8d5624e0.js"><link rel="prefetch" href="/assets/js/35.abd48ffb.js"><link rel="prefetch" href="/assets/js/36.e231ea32.js"><link rel="prefetch" href="/assets/js/37.e99c1b8f.js"><link rel="prefetch" href="/assets/js/38.ff825294.js"><link rel="prefetch" href="/assets/js/39.b3321103.js"><link rel="prefetch" href="/assets/js/4.936c6377.js"><link rel="prefetch" href="/assets/js/40.8e915e21.js"><link rel="prefetch" href="/assets/js/41.9a5c6a3d.js"><link rel="prefetch" href="/assets/js/42.2159b3c3.js"><link rel="prefetch" href="/assets/js/43.144bc67d.js"><link rel="prefetch" href="/assets/js/44.c7b1a0a9.js"><link rel="prefetch" href="/assets/js/46.dfd415c1.js"><link rel="prefetch" href="/assets/js/47.d6285fa6.js"><link rel="prefetch" href="/assets/js/48.c3c90153.js"><link rel="prefetch" href="/assets/js/49.fa7ab119.js"><link rel="prefetch" href="/assets/js/5.0bd232c4.js"><link rel="prefetch" href="/assets/js/50.6d5fe086.js"><link rel="prefetch" href="/assets/js/51.e0b9a5c9.js"><link rel="prefetch" href="/assets/js/52.39d71cb2.js"><link rel="prefetch" href="/assets/js/53.ad47bc0c.js"><link rel="prefetch" href="/assets/js/54.989d4596.js"><link rel="prefetch" href="/assets/js/55.fea0aaad.js"><link rel="prefetch" href="/assets/js/56.af246d88.js"><link rel="prefetch" href="/assets/js/57.747bce1d.js"><link rel="prefetch" href="/assets/js/58.8d177768.js"><link rel="prefetch" href="/assets/js/59.e97890fd.js"><link rel="prefetch" href="/assets/js/6.8aac6fc8.js"><link rel="prefetch" href="/assets/js/60.114e9ca6.js"><link rel="prefetch" href="/assets/js/7.f1ea8070.js"><link rel="prefetch" href="/assets/js/8.af678f34.js"><link rel="prefetch" href="/assets/js/9.a1b28891.js">
    <link rel="stylesheet" href="/assets/css/0.styles.39493abb.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div><div class="theme-container" data-v-e3b9d544><div data-v-e3b9d544><div id="loader-wrapper" class="loading-wrapper" data-v-1c4f0192 data-v-e3b9d544 data-v-e3b9d544><div class="loader-main" data-v-1c4f0192><div data-v-1c4f0192></div><div data-v-1c4f0192></div><div data-v-1c4f0192></div><div data-v-1c4f0192></div></div> <!----> <!----></div> <div class="password-shadow password-wrapper-out" style="display:none;" data-v-071f7da2 data-v-e3b9d544 data-v-e3b9d544><h3 class="title" style="display:none;" data-v-071f7da2 data-v-071f7da2>눈_눈？</h3> <!----> <label id="box" class="inputBox" style="display:none;" data-v-071f7da2 data-v-071f7da2><input type="password" value="" data-v-071f7da2> <span data-v-071f7da2>Konck! Knock!</span> <button data-v-071f7da2>OK</button></label> <div class="footer" style="display:none;" data-v-071f7da2 data-v-071f7da2><span data-v-071f7da2><i class="iconfont reco-theme" data-v-071f7da2></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-071f7da2>vuePress-theme-reco</a></span> <span data-v-071f7da2><i class="iconfont reco-other" data-v-071f7da2></i> <a data-v-071f7da2>yykrlc</a></span> <span data-v-071f7da2><i class="iconfont reco-copyright" data-v-071f7da2></i> <a data-v-071f7da2>2021</a></span></div></div> <div class="hide" data-v-e3b9d544><header class="navbar" data-v-e3b9d544><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/head.png" alt="눈_눈？" class="logo"> <span class="site-name">눈_눈？</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/朗读/" class="nav-link"><i class="iconfont undefined"></i>
  朗读
</a></li><li class="dropdown-item"><!----> <a href="/categories/工具/" class="nav-link"><i class="iconfont undefined"></i>
  工具
</a></li><li class="dropdown-item"><!----> <a href="/categories/Docker/" class="nav-link"><i class="iconfont undefined"></i>
  Docker
</a></li><li class="dropdown-item"><!----> <a href="/categories/Linux/" class="nav-link"><i class="iconfont undefined"></i>
  Linux
</a></li><li class="dropdown-item"><!----> <a href="/categories/sql/" class="nav-link"><i class="iconfont undefined"></i>
  sql
</a></li><li class="dropdown-item"><!----> <a href="/categories/其他/" class="nav-link"><i class="iconfont undefined"></i>
  其他
</a></li><li class="dropdown-item"><!----> <a href="/categories/Other/" class="nav-link"><i class="iconfont undefined"></i>
  Other
</a></li><li class="dropdown-item"><!----> <a href="/categories/python/" class="nav-link"><i class="iconfont undefined"></i>
  python
</a></li><li class="dropdown-item"><!----> <a href="/categories/Vue/" class="nav-link"><i class="iconfont undefined"></i>
  Vue
</a></li><li class="dropdown-item"><!----> <a href="/categories/Css/" class="nav-link"><i class="iconfont undefined"></i>
  Css
</a></li><li class="dropdown-item"><!----> <a href="/categories/JavaScript/" class="nav-link"><i class="iconfont undefined"></i>
  JavaScript
</a></li><li class="dropdown-item"><!----> <a href="/categories/闲言碎语/" class="nav-link"><i class="iconfont undefined"></i>
  闲言碎语
</a></li></ul></div></div><div class="nav-item"><a href="/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/tools/" class="nav-link"><i class="iconfont reco-document"></i>
  收藏
</a></div><div class="nav-item"><a href="/photo/" class="nav-link"><i class="iconfont reco-douyin"></i>
  画廊
</a></div><div class="nav-item"><a href="/friends/" class="nav-link"><i class="iconfont reco-friend"></i>
  关于
</a></div><div class="nav-item"><a href="/timeLine/" class="nav-link"><i class="iconfont reco-date"></i>
  时间轴
</a></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-e3b9d544></div> <aside class="sidebar" data-v-e3b9d544><div class="personal-info-wrapper" data-v-c115f482><img src="/assets/img/home-head.32578f7e.png" alt="hero" class="personal-img" data-v-c115f482> <h3 class="name" data-v-c115f482>yykrlc</h3> <div class="num" data-v-c115f482><div data-v-c115f482><h3 data-v-c115f482>44</h3> <h6 data-v-c115f482>文章</h6></div> <div data-v-c115f482><h3 data-v-c115f482>27</h3> <h6 data-v-c115f482>标签</h6></div></div> <hr data-v-c115f482></div> <nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/朗读/" class="nav-link"><i class="iconfont undefined"></i>
  朗读
</a></li><li class="dropdown-item"><!----> <a href="/categories/工具/" class="nav-link"><i class="iconfont undefined"></i>
  工具
</a></li><li class="dropdown-item"><!----> <a href="/categories/Docker/" class="nav-link"><i class="iconfont undefined"></i>
  Docker
</a></li><li class="dropdown-item"><!----> <a href="/categories/Linux/" class="nav-link"><i class="iconfont undefined"></i>
  Linux
</a></li><li class="dropdown-item"><!----> <a href="/categories/sql/" class="nav-link"><i class="iconfont undefined"></i>
  sql
</a></li><li class="dropdown-item"><!----> <a href="/categories/其他/" class="nav-link"><i class="iconfont undefined"></i>
  其他
</a></li><li class="dropdown-item"><!----> <a href="/categories/Other/" class="nav-link"><i class="iconfont undefined"></i>
  Other
</a></li><li class="dropdown-item"><!----> <a href="/categories/python/" class="nav-link"><i class="iconfont undefined"></i>
  python
</a></li><li class="dropdown-item"><!----> <a href="/categories/Vue/" class="nav-link"><i class="iconfont undefined"></i>
  Vue
</a></li><li class="dropdown-item"><!----> <a href="/categories/Css/" class="nav-link"><i class="iconfont undefined"></i>
  Css
</a></li><li class="dropdown-item"><!----> <a href="/categories/JavaScript/" class="nav-link"><i class="iconfont undefined"></i>
  JavaScript
</a></li><li class="dropdown-item"><!----> <a href="/categories/闲言碎语/" class="nav-link"><i class="iconfont undefined"></i>
  闲言碎语
</a></li></ul></div></div><div class="nav-item"><a href="/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/tools/" class="nav-link"><i class="iconfont reco-document"></i>
  收藏
</a></div><div class="nav-item"><a href="/photo/" class="nav-link"><i class="iconfont reco-douyin"></i>
  画廊
</a></div><div class="nav-item"><a href="/friends/" class="nav-link"><i class="iconfont reco-friend"></i>
  关于
</a></div><div class="nav-item"><a href="/timeLine/" class="nav-link"><i class="iconfont reco-date"></i>
  时间轴
</a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>微信支付py</span> <!----></p> <!----></section></li></ul> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-071f7da2 data-v-e3b9d544><h3 class="title" style="display:none;" data-v-071f7da2 data-v-071f7da2>微信支付py</h3> <!----> <label id="box" class="inputBox" style="display:none;" data-v-071f7da2 data-v-071f7da2><input type="password" value="" data-v-071f7da2> <span data-v-071f7da2>Konck! Knock!</span> <button data-v-071f7da2>OK</button></label> <div class="footer" style="display:none;" data-v-071f7da2 data-v-071f7da2><span data-v-071f7da2><i class="iconfont reco-theme" data-v-071f7da2></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-071f7da2>vuePress-theme-reco</a></span> <span data-v-071f7da2><i class="iconfont reco-other" data-v-071f7da2></i> <a data-v-071f7da2>yykrlc</a></span> <span data-v-071f7da2><i class="iconfont reco-copyright" data-v-071f7da2></i> <a data-v-071f7da2>2021</a></span></div></div> <div data-v-e3b9d544><main class="page"><!----> <div class="page-title" style="display:none;"><h1>微信支付py</h1> <hr> <div data-v-3cf1d7fb><i class="iconfont reco-account" data-v-3cf1d7fb><span data-v-3cf1d7fb>yykrlc</span></i> <!----> <i class="iconfont reco-eye" data-v-3cf1d7fb><span id="/views/python/%E5%BE%AE%E4%BF%A1%E6%94%AF%E4%BB%98py%E7%89%88.html" data-flag-title="Your Article Title" class="leancloud-visitors" data-v-3cf1d7fb><a class="leancloud-visitors-count" style="font-size:.9rem;font-weight:normal;color:#999;"></a></span></i> <i class="iconfont reco-tag tags" data-v-3cf1d7fb><span class="tag-item" data-v-3cf1d7fb>
      微信支付
    </span></i></div></div> <div class="theme-reco-content content__default" style="display:none;"><div class="language-py line-numbers-mode"><pre class="language-py"><code>
<span class="token comment"># -*- coding:utf-8 -*-</span>
<span class="token comment"># weqweqwe</span>
<span class="token keyword">import</span> json
<span class="token keyword">import</span> time
<span class="token keyword">import</span> random
<span class="token keyword">import</span> hashlib
<span class="token keyword">import</span> threading
<span class="token keyword">from</span> urllib<span class="token punctuation">.</span>parse <span class="token keyword">import</span> quote
<span class="token keyword">import</span> xml<span class="token punctuation">.</span>etree<span class="token punctuation">.</span>ElementTree <span class="token keyword">as</span> ET
<span class="token keyword">import</span> requests

APPID <span class="token operator">=</span> <span class="token string">&quot;&quot;</span>
APPSECRET <span class="token operator">=</span> <span class="token string">&quot;&quot;</span>
MCHID <span class="token operator">=</span> <span class="token string">&quot;&quot;</span>
PAY_KEY <span class="token operator">=</span> <span class="token string">&quot;&quot;</span>
RETURN_URL <span class="token operator">=</span> <span class="token string">&quot;&quot;</span>
<span class="token comment"># 公司微信账号信息（用于机构充值）</span>

<span class="token triple-quoted-string string">&quot;&quot;&quot;
 * 【CommonUtil】常用工具：
 *      trimString()，设置参数时需要用到的字符处理函数
 *      createNoncestr()，产生随机字符串，不长于32位
 *      formatBizQueryParaMap(),格式化参数，签名过程需要用到
 *      getSign(),生成签名
 *      arrayToXml(),array转xml
 *      xmlToArray(),xml转 array
 *      postXmlCurl(),以post方式提交xml到对应的接口url
 *      postXmlSSLCurl(),使用证书，以post方式提交xml到对应的接口url
&quot;&quot;&quot;</span>

<span class="token keyword">class</span> <span class="token class-name">BaseHttpClient</span><span class="token punctuation">(</span><span class="token builtin">object</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    include_ssl <span class="token operator">=</span> <span class="token boolean">False</span>

    <span class="token keyword">def</span> <span class="token function">get</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token operator">=</span><span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> self<span class="token punctuation">.</span>include_ssl<span class="token punctuation">:</span>
            <span class="token keyword">return</span> self<span class="token punctuation">.</span>postXmlSSL<span class="token punctuation">(</span><span class="token boolean">None</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token punctuation">,</span> <span class="token boolean">False</span><span class="token punctuation">,</span> <span class="token boolean">False</span><span class="token punctuation">)</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            <span class="token keyword">return</span> self<span class="token punctuation">.</span>postXml<span class="token punctuation">(</span><span class="token boolean">None</span><span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">postXml</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> xml<span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token operator">=</span><span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> self<span class="token punctuation">.</span>include_ssl<span class="token punctuation">:</span>
            <span class="token keyword">return</span> self<span class="token punctuation">.</span>postXmlSSL<span class="token punctuation">(</span>xml<span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token punctuation">,</span> cert<span class="token operator">=</span><span class="token boolean">False</span><span class="token punctuation">)</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            <span class="token keyword">raise</span> NotImplementedError<span class="token punctuation">(</span><span class="token string">&quot;please implement postXML&quot;</span><span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">postXmlSSL</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> xml<span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token operator">=</span><span class="token number">30</span><span class="token punctuation">,</span> cert<span class="token operator">=</span><span class="token boolean">True</span><span class="token punctuation">,</span> post<span class="token operator">=</span><span class="token boolean">True</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">raise</span> NotImplementedError<span class="token punctuation">(</span><span class="token string">&quot;please implement postXMLSSL&quot;</span><span class="token punctuation">)</span>


<span class="token keyword">class</span> <span class="token class-name">RequestsClient</span><span class="token punctuation">(</span>BaseHttpClient<span class="token punctuation">)</span><span class="token punctuation">:</span>
    include_ssl <span class="token operator">=</span> <span class="token boolean">True</span>

    <span class="token keyword">def</span> <span class="token function">postXmlSSL</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> xml<span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token operator">=</span><span class="token number">30</span><span class="token punctuation">,</span> cert<span class="token operator">=</span><span class="token boolean">True</span><span class="token punctuation">,</span> post<span class="token operator">=</span><span class="token boolean">True</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> cert<span class="token punctuation">:</span>
            cert_config <span class="token operator">=</span> <span class="token punctuation">(</span>WxPayConf_pub<span class="token punctuation">.</span>SSLCERT_PATH<span class="token punctuation">,</span> WxPayConf_pub<span class="token punctuation">.</span>SSLKEY_PATH<span class="token punctuation">)</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            cert_config <span class="token operator">=</span> <span class="token boolean">None</span>
        <span class="token keyword">if</span> post<span class="token punctuation">:</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'----------post----------'</span><span class="token punctuation">)</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'url-'</span><span class="token punctuation">,</span> url<span class="token punctuation">)</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'xml-'</span><span class="token punctuation">,</span> xml<span class="token punctuation">)</span>
            <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">'cert_config-'</span><span class="token punctuation">,</span> cert_config<span class="token punctuation">)</span>
            res <span class="token operator">=</span> requests<span class="token punctuation">.</span>post<span class="token punctuation">(</span>url<span class="token punctuation">,</span> data<span class="token operator">=</span>xml<span class="token punctuation">,</span> cert<span class="token operator">=</span>cert_config<span class="token punctuation">)</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            res <span class="token operator">=</span> requests<span class="token punctuation">.</span>get<span class="token punctuation">(</span>url<span class="token punctuation">,</span> timeout<span class="token operator">=</span>second<span class="token punctuation">,</span> cert<span class="token operator">=</span>cert_config<span class="token punctuation">)</span>
        <span class="token keyword">return</span> res<span class="token punctuation">.</span>content


<span class="token keyword">class</span> <span class="token class-name">WxPayConf_pub</span><span class="token punctuation">(</span><span class="token builtin">object</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;配置账号信息&quot;&quot;&quot;</span>

    <span class="token comment"># =======【基本信息设置】=====================================</span>
    <span class="token comment"># 微信公众号身份的唯一标识。审核通过后，在微信发送的邮件中查看</span>
    APPID <span class="token operator">=</span> APPID
    <span class="token comment"># JSAPI接口中获取openid，审核后在公众平台开启开发模式后可查看</span>
    APPSECRET <span class="token operator">=</span> APPSECRET
    <span class="token comment"># 接口配置token</span>
    TOKEN <span class="token operator">=</span> <span class="token string">&quot;brain&quot;</span>
    <span class="token comment"># 受理商ID，身份标识</span>
    MCHID <span class="token operator">=</span> MCHID
    <span class="token comment"># 商户支付密钥Key。审核通过后，在微信发送的邮件中查看</span>
    KEY <span class="token operator">=</span> PAY_KEY

    <span class="token comment"># =======【异步通知url设置】===================================</span>
    <span class="token comment"># 异步通知url，商户根据实际开发过程设定</span>
    NOTIFY_URL <span class="token operator">=</span> RETURN_URL

    <span class="token comment"># =======【证书路径设置】=证书路径,注意应该填写绝对路径===</span>
    SSLCERT_PATH <span class="token operator">=</span> <span class="token string">&quot;/******/cacert/apiclient_cert.pem&quot;</span>
    SSLKEY_PATH <span class="token operator">=</span> <span class="token string">&quot;/******/cacert/apiclient_key.pem&quot;</span>

    <span class="token comment"># =======【curl超时设置】===================================</span>
    CURL_TIMEOUT <span class="token operator">=</span> <span class="token number">30</span>
    <span class="token comment"># =======HTTP客户端设置===================================</span>
    <span class="token comment"># ## URLLIB,CURL,REQUESTS</span>
    HTTP_CLIENT <span class="token operator">=</span> <span class="token string">&quot;REQUESTS&quot;</span>
    <span class="token comment"># end</span>
    
<span class="token keyword">class</span> <span class="token class-name">WeixinHelper</span><span class="token punctuation">(</span><span class="token builtin">object</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token decorator annotation punctuation">@classmethod</span>
    <span class="token keyword">def</span> <span class="token function">xmlToArray</span><span class="token punctuation">(</span>cls<span class="token punctuation">,</span> xml<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;将xml转为array&quot;&quot;&quot;</span>
    <span class="token keyword">return</span> <span class="token builtin">dict</span><span class="token punctuation">(</span><span class="token punctuation">(</span>child<span class="token punctuation">.</span>tag<span class="token punctuation">,</span> child<span class="token punctuation">.</span>text<span class="token punctuation">)</span> <span class="token keyword">for</span> child <span class="token keyword">in</span> ET<span class="token punctuation">.</span>fromstring<span class="token punctuation">(</span>xml<span class="token punctuation">)</span><span class="token punctuation">)</span>
    
<span class="token keyword">class</span> <span class="token class-name">Singleton</span><span class="token punctuation">(</span><span class="token builtin">object</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;可配置单例模式&quot;&quot;&quot;</span>

    _instance_lock <span class="token operator">=</span> threading<span class="token punctuation">.</span>Lock<span class="token punctuation">(</span><span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">__new__</span><span class="token punctuation">(</span>cls<span class="token punctuation">,</span> <span class="token operator">*</span>args<span class="token punctuation">,</span> <span class="token operator">**</span>kwargs<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> <span class="token keyword">not</span> <span class="token builtin">hasattr</span><span class="token punctuation">(</span>cls<span class="token punctuation">,</span> <span class="token string">&quot;_instance&quot;</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">with</span> cls<span class="token punctuation">.</span>_instance_lock<span class="token punctuation">:</span>
                <span class="token keyword">if</span> <span class="token keyword">not</span> <span class="token builtin">hasattr</span><span class="token punctuation">(</span>cls<span class="token punctuation">,</span> <span class="token string">&quot;_instance&quot;</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
                    impl <span class="token operator">=</span> cls<span class="token punctuation">.</span>configure<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">if</span> <span class="token builtin">hasattr</span><span class="token punctuation">(</span>cls<span class="token punctuation">,</span> <span class="token string">&quot;configure&quot;</span><span class="token punctuation">)</span> <span class="token keyword">else</span> cls
                    instance <span class="token operator">=</span> <span class="token builtin">super</span><span class="token punctuation">(</span>Singleton<span class="token punctuation">,</span> cls<span class="token punctuation">)</span><span class="token punctuation">.</span>__new__<span class="token punctuation">(</span>impl<span class="token punctuation">,</span> <span class="token operator">*</span>args<span class="token punctuation">,</span> <span class="token operator">**</span>kwargs<span class="token punctuation">)</span>
                    <span class="token keyword">if</span> <span class="token keyword">not</span> <span class="token builtin">isinstance</span><span class="token punctuation">(</span>instance<span class="token punctuation">,</span> cls<span class="token punctuation">)</span><span class="token punctuation">:</span>
                        instance<span class="token punctuation">.</span>__init__<span class="token punctuation">(</span><span class="token operator">*</span>args<span class="token punctuation">,</span> <span class="token operator">**</span>kwargs<span class="token punctuation">)</span>
                    cls<span class="token punctuation">.</span>_instance <span class="token operator">=</span> instance
        <span class="token keyword">return</span> cls<span class="token punctuation">.</span>_instance


<span class="token keyword">def</span> <span class="token function">get_info</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    app_info_dict <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
    app_info_dict<span class="token punctuation">[</span><span class="token string">&quot;APPID&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> APPID
    app_info_dict<span class="token punctuation">[</span><span class="token string">&quot;APPSECRET&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> APPSECRET
    app_info_dict<span class="token punctuation">[</span><span class="token string">&quot;MCHID&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> MCHID
    app_info_dict<span class="token punctuation">[</span><span class="token string">&quot;KEY&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> PAY_KEY
    <span class="token keyword">return</span> app_info_dict


<span class="token keyword">class</span> <span class="token class-name">Common_util_pub</span><span class="token punctuation">(</span><span class="token builtin">object</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;所有接口的基类&quot;&quot;&quot;</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">pass</span>

    <span class="token keyword">def</span> <span class="token function">get_info</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>info <span class="token operator">=</span> get_info<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>info

    <span class="token keyword">def</span> <span class="token function">trimString</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> value<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token keyword">if</span> value <span class="token keyword">is</span> <span class="token keyword">not</span> <span class="token boolean">None</span> <span class="token keyword">and</span> <span class="token builtin">len</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">:</span>
            value <span class="token operator">=</span> <span class="token boolean">None</span>
        <span class="token keyword">return</span> value

    <span class="token keyword">def</span> <span class="token function">createNoncestr</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> length<span class="token operator">=</span><span class="token number">32</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;产生随机字符串，不长于32位&quot;&quot;&quot;</span>
        chars <span class="token operator">=</span> <span class="token string">&quot;abcdefghijklmnopqrstuvwxyz&quot;</span>
        strs <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
        <span class="token keyword">for</span> x <span class="token keyword">in</span> <span class="token builtin">range</span><span class="token punctuation">(</span>length<span class="token punctuation">)</span><span class="token punctuation">:</span>
            strs<span class="token punctuation">.</span>append<span class="token punctuation">(</span>chars<span class="token punctuation">[</span>random<span class="token punctuation">.</span>randrange<span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token builtin">len</span><span class="token punctuation">(</span>chars<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span>strs<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">formatBizQueryParaMap</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> paraMap<span class="token punctuation">,</span> urlencode<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;格式化参数，签名过程需要使用&quot;&quot;&quot;</span>
        slist <span class="token operator">=</span> <span class="token builtin">sorted</span><span class="token punctuation">(</span>paraMap<span class="token punctuation">)</span>
        buff <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
        <span class="token keyword">for</span> k <span class="token keyword">in</span> slist<span class="token punctuation">:</span>
            v <span class="token operator">=</span> quote<span class="token punctuation">(</span>paraMap<span class="token punctuation">[</span>k<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">if</span> urlencode <span class="token keyword">else</span> paraMap<span class="token punctuation">[</span>k<span class="token punctuation">]</span>
            buff<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token string">&quot;{0}={1}&quot;</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>k<span class="token punctuation">,</span> v<span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> <span class="token string">&quot;&amp;&quot;</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span>buff<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">getSign</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> obj<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;生成签名&quot;&quot;&quot;</span>
        <span class="token comment"># 签名步骤一：按字典序排序参数,formatBizQueryParaMap已做</span>
        String <span class="token operator">=</span> self<span class="token punctuation">.</span>formatBizQueryParaMap<span class="token punctuation">(</span>obj<span class="token punctuation">,</span> <span class="token boolean">False</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;排序1&quot;</span><span class="token punctuation">,</span> String<span class="token punctuation">)</span>
        <span class="token comment"># 签名步骤二：在string后加入KEY</span>
        info <span class="token operator">=</span> get_info<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token keyword">if</span> info<span class="token punctuation">:</span>
            KEY <span class="token operator">=</span> info<span class="token punctuation">[</span><span class="token string">&quot;KEY&quot;</span><span class="token punctuation">]</span>
        <span class="token keyword">else</span><span class="token punctuation">:</span>
            KEY <span class="token operator">=</span> WxPayConf_pub<span class="token punctuation">.</span>KEY
        String <span class="token operator">=</span> <span class="token string">&quot;{0}&amp;key={1}&quot;</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>String<span class="token punctuation">,</span> KEY<span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;加Key2&quot;</span><span class="token punctuation">,</span> String<span class="token punctuation">)</span>
        <span class="token comment"># 签名步骤三：MD5加密</span>
        <span class="token comment"># String = String.encode('utf8')</span>
        String <span class="token operator">=</span> String<span class="token punctuation">.</span>encode<span class="token punctuation">(</span><span class="token string">'ISO8859-1'</span><span class="token punctuation">)</span>
        String <span class="token operator">=</span> hashlib<span class="token punctuation">.</span>md5<span class="token punctuation">(</span>String<span class="token punctuation">)</span><span class="token punctuation">.</span>hexdigest<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;MD5加密3&quot;</span><span class="token punctuation">,</span> String<span class="token punctuation">)</span>
        <span class="token comment"># 签名步骤四：所有字符转为大写</span>
        result_ <span class="token operator">=</span> String<span class="token punctuation">.</span>upper<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;大写4&quot;</span><span class="token punctuation">,</span> result_<span class="token punctuation">)</span>
        <span class="token keyword">return</span> result_

    <span class="token keyword">def</span> <span class="token function">arrayToXml</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> arr<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;array转xml&quot;&quot;&quot;</span>
        xml <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">&quot;&lt;xml&gt;&quot;</span><span class="token punctuation">]</span>
        <span class="token keyword">for</span> k<span class="token punctuation">,</span> v <span class="token keyword">in</span> arr<span class="token punctuation">.</span>items<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">if</span> v<span class="token punctuation">.</span>isdigit<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
                xml<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token string">&quot;&lt;{0}&gt;{1}&lt;/{0}&gt;&quot;</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>k<span class="token punctuation">,</span> v<span class="token punctuation">)</span><span class="token punctuation">)</span>
            <span class="token keyword">else</span><span class="token punctuation">:</span>
                xml<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token string">&quot;&lt;{0}&gt;&lt;![CDATA[{1}]]&gt;&lt;/{0}&gt;&quot;</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>k<span class="token punctuation">,</span> v<span class="token punctuation">)</span><span class="token punctuation">)</span>
        xml<span class="token punctuation">.</span>append<span class="token punctuation">(</span><span class="token string">&quot;&lt;/xml&gt;&quot;</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span>xml<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">xmlToArray</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> xml<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;将xml转为array&quot;&quot;&quot;</span>
        <span class="token keyword">return</span> WeixinHelper<span class="token punctuation">.</span>xmlToArray<span class="token punctuation">(</span>xml<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">postXmlCurl</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> xml<span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token operator">=</span><span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;以post方式提交xml到对应的接口url&quot;&quot;&quot;</span>
        <span class="token keyword">return</span> RequestsClient<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>postXml<span class="token punctuation">(</span>xml<span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token operator">=</span>second<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">postXmlSSLCurl</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> xml<span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token operator">=</span><span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;使用证书，以post方式提交xml到对应的接口url&quot;&quot;&quot;</span>
        <span class="token keyword">return</span> RequestsClient<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>postXmlSSL<span class="token punctuation">(</span>xml<span class="token punctuation">,</span> url<span class="token punctuation">,</span> second<span class="token operator">=</span>second<span class="token punctuation">)</span>


<span class="token keyword">class</span> <span class="token class-name">JsApi_pub</span><span class="token punctuation">(</span>Common_util_pub<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;JSAPI支付——H5网页端调起支付接口&quot;&quot;&quot;</span>
    code <span class="token operator">=</span> <span class="token boolean">None</span>  <span class="token comment"># code码，用以获取openid</span>
    openid <span class="token operator">=</span> <span class="token boolean">None</span>  <span class="token comment"># 用户的openid</span>
    parameters <span class="token operator">=</span> <span class="token boolean">None</span>  <span class="token comment"># jsapi参数，格式为json</span>
    prepay_id <span class="token operator">=</span> <span class="token boolean">None</span>  <span class="token comment"># 使用统一支付接口得到的预支付id</span>
    curl_timeout <span class="token operator">=</span> <span class="token boolean">None</span>  <span class="token comment"># curl超时时间</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> timeout<span class="token operator">=</span>WxPayConf_pub<span class="token punctuation">.</span>CURL_TIMEOUT<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>curl_timeout <span class="token operator">=</span> timeout

        self<span class="token punctuation">.</span>info <span class="token operator">=</span> get_info<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token builtin">super</span><span class="token punctuation">(</span>JsApi_pub<span class="token punctuation">,</span> self<span class="token punctuation">)</span><span class="token punctuation">.</span>__init__<span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">def</span> <span class="token function">createOauthUrlForCode</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> redirectUrl<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;生成可以获得code的url&quot;&quot;&quot;</span>
        urlObj <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
        urlObj<span class="token punctuation">[</span><span class="token string">&quot;appid&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;APPID&quot;</span><span class="token punctuation">]</span>
        urlObj<span class="token punctuation">[</span><span class="token string">&quot;redirect_uri&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> redirectUrl
        urlObj<span class="token punctuation">[</span><span class="token string">&quot;response_type&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;code&quot;</span>
        urlObj<span class="token punctuation">[</span><span class="token string">&quot;scope&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;snsapi_base&quot;</span>
        urlObj<span class="token punctuation">[</span><span class="token string">&quot;state&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;STATE#wechat_redirect&quot;</span>
        bizString <span class="token operator">=</span> self<span class="token punctuation">.</span>formatBizQueryParaMap<span class="token punctuation">(</span>urlObj<span class="token punctuation">,</span> <span class="token boolean">False</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> <span class="token string">&quot;https://open.weixin.qq.com/connect/oauth2/authorize?&quot;</span> <span class="token operator">+</span> bizString
        
    <span class="token keyword">def</span> <span class="token function">createOauthUrlForOpenid</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;生成可以获得openid的url&quot;&quot;&quot;</span>
        urlObj <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
        urlObj<span class="token punctuation">[</span><span class="token string">&quot;appid&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;APPID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>APPID
        urlObj<span class="token punctuation">[</span><span class="token string">&quot;secret&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;APPSECRET&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>APPSECRET
        urlObj<span class="token punctuation">[</span><span class="token string">&quot;code&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>code
        urlObj<span class="token punctuation">[</span><span class="token string">&quot;grant_type&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;authorization_code&quot;</span>
        bizString <span class="token operator">=</span> self<span class="token punctuation">.</span>formatBizQueryParaMap<span class="token punctuation">(</span>urlObj<span class="token punctuation">,</span> <span class="token boolean">False</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> <span class="token string">&quot;https://api.weixin.qq.com/sns/oauth2/access_token?&quot;</span> <span class="token operator">+</span> bizString
        
    <span class="token keyword">def</span> <span class="token function">getOpenid</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;通过curl向微信提交code，以获取openid&quot;&quot;&quot;</span>
        url <span class="token operator">=</span> self<span class="token punctuation">.</span>createOauthUrlForOpenid<span class="token punctuation">(</span><span class="token punctuation">)</span>
        data <span class="token operator">=</span> RequestsClient<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>get<span class="token punctuation">(</span>url<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>openid <span class="token operator">=</span> json<span class="token punctuation">.</span>loads<span class="token punctuation">(</span>data<span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">&quot;openid&quot;</span><span class="token punctuation">]</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>openid

    <span class="token keyword">def</span> <span class="token function">setPrepayId</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> prepayId<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;设置prepay_id&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>prepay_id <span class="token operator">=</span> prepayId

    <span class="token keyword">def</span> <span class="token function">setCode</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> code<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;设置code&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>code <span class="token operator">=</span> code
        
    <span class="token keyword">def</span> <span class="token function">getParameters</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;设置jsapi的参数&quot;&quot;&quot;</span>
        jsApiObj <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
        jsApiObj<span class="token punctuation">[</span><span class="token string">&quot;appId&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;APPID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>APPID
        timeStamp <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span>time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        jsApiObj<span class="token punctuation">[</span><span class="token string">&quot;timeStamp&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;{0}&quot;</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>timeStamp<span class="token punctuation">)</span>
        jsApiObj<span class="token punctuation">[</span><span class="token string">&quot;nonceStr&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>createNoncestr<span class="token punctuation">(</span><span class="token punctuation">)</span>
        jsApiObj<span class="token punctuation">[</span><span class="token string">&quot;package&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;prepay_id={0}&quot;</span><span class="token punctuation">.</span><span class="token builtin">format</span><span class="token punctuation">(</span>self<span class="token punctuation">.</span>prepay_id<span class="token punctuation">)</span>
        jsApiObj<span class="token punctuation">[</span><span class="token string">&quot;signType&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;MD5&quot;</span>
        jsApiObj<span class="token punctuation">[</span><span class="token string">&quot;paySign&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>getSign<span class="token punctuation">(</span>jsApiObj<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>parameters <span class="token operator">=</span> json<span class="token punctuation">.</span>dumps<span class="token punctuation">(</span>jsApiObj<span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;##############get_Parameters#################&quot;</span><span class="token punctuation">,</span> self<span class="token punctuation">.</span>parameters<span class="token punctuation">)</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>parameters
        

<span class="token keyword">class</span> <span class="token class-name">Wxpay_client_pub</span><span class="token punctuation">(</span>Common_util_pub<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;请求型接口的基类&quot;&quot;&quot;</span>
    response <span class="token operator">=</span> <span class="token boolean">None</span>  <span class="token comment"># 微信返回的响应</span>
    url <span class="token operator">=</span> <span class="token boolean">None</span>  <span class="token comment"># 接口链接</span>
    curl_timeout <span class="token operator">=</span> <span class="token boolean">None</span>  <span class="token comment"># curl超时时间</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>parameters <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>  <span class="token comment"># 请求参数，类型为关联数组</span>
        self<span class="token punctuation">.</span>result <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>  <span class="token comment"># 返回参数，类型为关联数组</span>
        self<span class="token punctuation">.</span>info <span class="token operator">=</span> get_info<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token builtin">super</span><span class="token punctuation">(</span>Wxpay_client_pub<span class="token punctuation">,</span> self<span class="token punctuation">)</span><span class="token punctuation">.</span>__init__<span class="token punctuation">(</span><span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">setParameter</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> parameter<span class="token punctuation">,</span> parameterValue<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;设置请求参数&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span>self<span class="token punctuation">.</span>trimString<span class="token punctuation">(</span>parameter<span class="token punctuation">)</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>trimString<span class="token punctuation">(</span>parameterValue<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">createXml</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;设置标配的请求参数，生成签名，生成接口参数xml&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;appid&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;APPID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>APPID  <span class="token comment"># 公众账号ID</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;mch_id&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;MCHID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>MCHID  <span class="token comment"># 商户号</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;nonce_str&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>createNoncestr<span class="token punctuation">(</span><span class="token punctuation">)</span>  <span class="token comment"># 随机字符串</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;sign&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>getSign<span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">)</span>  <span class="token comment"># 签名</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>arrayToXml<span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">postXml</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;post请求xml&quot;&quot;&quot;</span>
        xml <span class="token operator">=</span> self<span class="token punctuation">.</span>createXml<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>xml<span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>response <span class="token operator">=</span> self<span class="token punctuation">.</span>postXmlCurl<span class="token punctuation">(</span>xml<span class="token punctuation">,</span> self<span class="token punctuation">.</span>url<span class="token punctuation">,</span> self<span class="token punctuation">.</span>curl_timeout<span class="token punctuation">)</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>response

    <span class="token keyword">def</span> <span class="token function">postXmlSSL</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;使用证书post请求xml&quot;&quot;&quot;</span>
        xml <span class="token operator">=</span> self<span class="token punctuation">.</span>createXml<span class="token punctuation">(</span><span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>response <span class="token operator">=</span> self<span class="token punctuation">.</span>postXmlSSLCurl<span class="token punctuation">(</span>xml<span class="token punctuation">,</span> self<span class="token punctuation">.</span>url<span class="token punctuation">,</span> self<span class="token punctuation">.</span>curl_timeout<span class="token punctuation">)</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>response

    <span class="token keyword">def</span> <span class="token function">getResult</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;获取结果，默认不使用证书&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>postXml<span class="token punctuation">(</span><span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>result <span class="token operator">=</span> self<span class="token punctuation">.</span>xmlToArray<span class="token punctuation">(</span>self<span class="token punctuation">.</span>response<span class="token punctuation">)</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>result
        

<span class="token keyword">class</span> <span class="token class-name">UnifiedOrder_pub</span><span class="token punctuation">(</span>Wxpay_client_pub<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;统一支付接口类&quot;&quot;&quot;</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> timeout<span class="token operator">=</span>WxPayConf_pub<span class="token punctuation">.</span>CURL_TIMEOUT<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token comment"># 设置接口链接</span>
        self<span class="token punctuation">.</span>url <span class="token operator">=</span> <span class="token string">&quot;https://api.mch.weixin.qq.com/pay/unifiedorder&quot;</span>
        <span class="token comment"># 设置curl超时时间</span>
        self<span class="token punctuation">.</span>curl_timeout <span class="token operator">=</span> timeout
        self<span class="token punctuation">.</span>info <span class="token operator">=</span> get_info<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token builtin">super</span><span class="token punctuation">(</span>UnifiedOrder_pub<span class="token punctuation">,</span> self<span class="token punctuation">)</span><span class="token punctuation">.</span>__init__<span class="token punctuation">(</span><span class="token punctuation">)</span>
        
    <span class="token keyword">def</span> <span class="token function">createXml</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;生成接口参数xml&quot;&quot;&quot;</span>
        <span class="token comment"># 检测必填参数</span>
        <span class="token keyword">if</span> <span class="token builtin">any</span><span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span>key<span class="token punctuation">]</span> <span class="token keyword">is</span> <span class="token boolean">None</span> <span class="token keyword">for</span> key <span class="token keyword">in</span>
               <span class="token punctuation">(</span><span class="token string">&quot;out_trade_no&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;body&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;total_fee&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;notify_url&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;trade_type&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">raise</span> ValueError<span class="token punctuation">(</span><span class="token string">&quot;missing parameter&quot;</span><span class="token punctuation">)</span>
        <span class="token keyword">if</span> self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;trade_type&quot;</span><span class="token punctuation">]</span> <span class="token operator">==</span> <span class="token string">&quot;JSAPI&quot;</span> <span class="token keyword">and</span> self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;openid&quot;</span><span class="token punctuation">]</span> <span class="token keyword">is</span> <span class="token boolean">None</span><span class="token punctuation">:</span>
            <span class="token keyword">raise</span> ValueError<span class="token punctuation">(</span><span class="token string">&quot;JSAPI need openid parameters&quot;</span><span class="token punctuation">)</span>

        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;appid&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;APPID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>APPID  <span class="token comment"># 公众账号ID</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;mch_id&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;MCHID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>MCHID  <span class="token comment"># 商户号</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;spbill_create_ip&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">&quot;127.0.0.1&quot;</span>  <span class="token comment"># 终端ip</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;nonce_str&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>createNoncestr<span class="token punctuation">(</span><span class="token punctuation">)</span>  <span class="token comment"># 随机字符串</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;sign&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>getSign<span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">)</span>  <span class="token comment"># 签名</span>
        parameters1 <span class="token operator">=</span> self<span class="token punctuation">.</span>arrayToXml<span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token keyword">import</span> pprint
        pprint<span class="token punctuation">.</span>pprint<span class="token punctuation">(</span>parameters1<span class="token punctuation">)</span>
        <span class="token keyword">return</span> parameters1
        
    <span class="token keyword">def</span> <span class="token function">getPrepayId</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;获取prepay_id&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>postXml<span class="token punctuation">(</span><span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>result <span class="token operator">=</span> self<span class="token punctuation">.</span>xmlToArray<span class="token punctuation">(</span>self<span class="token punctuation">.</span>response<span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;#######self.result#######&quot;</span><span class="token punctuation">,</span> self<span class="token punctuation">.</span>result<span class="token punctuation">)</span>
        prepay_id <span class="token operator">=</span> self<span class="token punctuation">.</span>result<span class="token punctuation">[</span><span class="token string">&quot;prepay_id&quot;</span><span class="token punctuation">]</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;#######prepay_id#######&quot;</span><span class="token punctuation">,</span> prepay_id<span class="token punctuation">)</span>
        <span class="token keyword">return</span> prepay_id
        
    <span class="token keyword">def</span> <span class="token function">getCode_url</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;获取支付二维码&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>postXml<span class="token punctuation">(</span><span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>result <span class="token operator">=</span> self<span class="token punctuation">.</span>xmlToArray<span class="token punctuation">(</span>self<span class="token punctuation">.</span>response<span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>self<span class="token punctuation">.</span>result<span class="token punctuation">)</span>
        <span class="token keyword">try</span><span class="token punctuation">:</span>
            code_url <span class="token operator">=</span> self<span class="token punctuation">.</span>result<span class="token punctuation">[</span><span class="token string">&quot;code_url&quot;</span><span class="token punctuation">]</span>
        <span class="token keyword">except</span><span class="token punctuation">:</span>
            code_url <span class="token operator">=</span> self<span class="token punctuation">.</span>result
        <span class="token keyword">return</span> code_url
        

<span class="token keyword">class</span> <span class="token class-name">OrderQuery_pub</span><span class="token punctuation">(</span>Wxpay_client_pub<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;订单查询接口&quot;&quot;&quot;</span>
    
    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> timeout<span class="token operator">=</span>WxPayConf_pub<span class="token punctuation">.</span>CURL_TIMEOUT<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token comment"># 设置接口链接</span>
        self<span class="token punctuation">.</span>url <span class="token operator">=</span> <span class="token string">&quot;https://api.mch.weixin.qq.com/pay/orderquery&quot;</span>
        <span class="token comment"># 设置curl超时时间</span>
        self<span class="token punctuation">.</span>curl_timeout <span class="token operator">=</span> timeout
        self<span class="token punctuation">.</span>info <span class="token operator">=</span> get_info<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token builtin">super</span><span class="token punctuation">(</span>OrderQuery_pub<span class="token punctuation">,</span> self<span class="token punctuation">)</span><span class="token punctuation">.</span>__init__<span class="token punctuation">(</span><span class="token punctuation">)</span>
        
    <span class="token keyword">def</span> <span class="token function">get_url</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;获取result_code,return_code&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>postXml<span class="token punctuation">(</span><span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>result <span class="token operator">=</span> self<span class="token punctuation">.</span>xmlToArray<span class="token punctuation">(</span>self<span class="token punctuation">.</span>response<span class="token punctuation">)</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span>self<span class="token punctuation">.</span>result<span class="token punctuation">,</span> <span class="token string">&quot;=__________________+++++++++++====&quot;</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>result
        
    <span class="token keyword">def</span> <span class="token function">createXml</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;生成接口参数xml&quot;&quot;&quot;</span>
        
        <span class="token comment"># 检测必填参数</span>
        <span class="token keyword">if</span> <span class="token keyword">not</span> <span class="token builtin">any</span><span class="token punctuation">(</span><span class="token punctuation">[</span>i <span class="token keyword">in</span> self<span class="token punctuation">.</span>parameters<span class="token punctuation">.</span>keys<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">for</span> i <span class="token keyword">in</span> <span class="token punctuation">(</span><span class="token string">&quot;out_trade_no&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;transaction_id&quot;</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">raise</span> ValueError<span class="token punctuation">(</span><span class="token string">&quot;missing parameter&quot;</span><span class="token punctuation">)</span>
            
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;appid&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;APPID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>APPID  <span class="token comment"># 公众账号ID</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;mch_id&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;MCHID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>MCHID  <span class="token comment"># 商户号</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;nonce_str&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>createNoncestr<span class="token punctuation">(</span><span class="token punctuation">)</span>  <span class="token comment"># 随机字符串</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;sign&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>getSign<span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">)</span>  <span class="token comment"># 签名</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>arrayToXml<span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">)</span>
        

<span class="token keyword">class</span> <span class="token class-name">DownloadBill_pub</span><span class="token punctuation">(</span>Wxpay_client_pub<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;对账单接口&quot;&quot;&quot;</span>
    
    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> timeout<span class="token operator">=</span>WxPayConf_pub<span class="token punctuation">.</span>CURL_TIMEOUT<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token comment"># 设置接口链接</span>
        self<span class="token punctuation">.</span>url <span class="token operator">=</span> <span class="token string">&quot;https://api.mch.weixin.qq.com/pay/downloadbill&quot;</span>
        <span class="token comment"># 设置curl超时时间</span>
        self<span class="token punctuation">.</span>curl_timeout <span class="token operator">=</span> timeout
        self<span class="token punctuation">.</span>info <span class="token operator">=</span> get_info<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token builtin">super</span><span class="token punctuation">(</span>DownloadBill_pub<span class="token punctuation">,</span> self<span class="token punctuation">)</span><span class="token punctuation">.</span>__init__<span class="token punctuation">(</span><span class="token punctuation">)</span>
        
    <span class="token keyword">def</span> <span class="token function">createXml</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;生成接口参数xml&quot;&quot;&quot;</span>
        <span class="token keyword">if</span> <span class="token builtin">any</span><span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span>key<span class="token punctuation">]</span> <span class="token keyword">is</span> <span class="token boolean">None</span> <span class="token keyword">for</span> key <span class="token keyword">in</span> <span class="token punctuation">(</span><span class="token string">&quot;bill_date&quot;</span><span class="token punctuation">,</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
            <span class="token keyword">raise</span> ValueError<span class="token punctuation">(</span><span class="token string">&quot;missing parameter&quot;</span><span class="token punctuation">)</span>
            
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;appid&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;APPID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>APPID  <span class="token comment"># 公众账号ID</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;mch_id&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;MCHID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>MCHID  <span class="token comment"># 商户号</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;nonce_str&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>createNoncestr<span class="token punctuation">(</span><span class="token punctuation">)</span>  <span class="token comment"># 随机字符串</span>
        self<span class="token punctuation">.</span>parameters<span class="token punctuation">[</span><span class="token string">&quot;sign&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>getSign<span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">)</span>  <span class="token comment"># 签名</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>arrayToXml<span class="token punctuation">(</span>self<span class="token punctuation">.</span>parameters<span class="token punctuation">)</span>
    
    <span class="token keyword">def</span> <span class="token function">getResult</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;获取结果，默认不使用证书&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>postXml<span class="token punctuation">(</span><span class="token punctuation">)</span>
        self<span class="token punctuation">.</span>result <span class="token operator">=</span> self<span class="token punctuation">.</span>xmlToArray<span class="token punctuation">(</span>self<span class="token punctuation">.</span>response<span class="token punctuation">)</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>result


<span class="token keyword">class</span> <span class="token class-name">Wxpay_server_pub</span><span class="token punctuation">(</span>Common_util_pub<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;响应型接口基类&quot;&quot;&quot;</span>
    SUCCESS<span class="token punctuation">,</span> FAIL <span class="token operator">=</span> <span class="token string">&quot;SUCCESS&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;FAIL&quot;</span>

    <span class="token keyword">def</span> <span class="token function">__init__</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        self<span class="token punctuation">.</span>data <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>  <span class="token comment"># 接收到的数据，类型为关联数组</span>
        self<span class="token punctuation">.</span>returnParameters <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>  <span class="token comment"># 返回参数，类型为关联数组</span>
        self<span class="token punctuation">.</span>info <span class="token operator">=</span> get_info<span class="token punctuation">(</span><span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">saveData</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> xml<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;将微信的请求xml转换成关联数组，以方便数据处理&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>data <span class="token operator">=</span> self<span class="token punctuation">.</span>xmlToArray<span class="token punctuation">(</span>xml<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">checkSign</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;校验签名&quot;&quot;&quot;</span>
        tmpData <span class="token operator">=</span> <span class="token builtin">dict</span><span class="token punctuation">(</span>self<span class="token punctuation">.</span>data<span class="token punctuation">)</span>  <span class="token comment"># make a copy to save sign</span>
        <span class="token keyword">del</span> tmpData<span class="token punctuation">[</span><span class="token string">'sign'</span><span class="token punctuation">]</span>
        sign <span class="token operator">=</span> self<span class="token punctuation">.</span>getSign<span class="token punctuation">(</span>tmpData<span class="token punctuation">)</span>  <span class="token comment"># 本地签名</span>
        <span class="token keyword">if</span> self<span class="token punctuation">.</span>data<span class="token punctuation">[</span><span class="token string">'sign'</span><span class="token punctuation">]</span> <span class="token operator">==</span> sign<span class="token punctuation">:</span>
            <span class="token keyword">return</span> <span class="token boolean">True</span>
        <span class="token keyword">return</span> <span class="token boolean">False</span>
        
    <span class="token keyword">def</span> <span class="token function">getData</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;获取微信的请求数据&quot;&quot;&quot;</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>data

    <span class="token keyword">def</span> <span class="token function">setReturnParameter</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> parameter<span class="token punctuation">,</span> parameterValue<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;设置返回微信的xml数据&quot;&quot;&quot;</span>
        self<span class="token punctuation">.</span>returnParameters<span class="token punctuation">[</span>self<span class="token punctuation">.</span>trimString<span class="token punctuation">(</span>parameter<span class="token punctuation">)</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>trimString<span class="token punctuation">(</span>parameterValue<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">createXml</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;生成接口参数xml&quot;&quot;&quot;</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>arrayToXml<span class="token punctuation">(</span>self<span class="token punctuation">.</span>returnParameters<span class="token punctuation">)</span>

    <span class="token keyword">def</span> <span class="token function">returnXml</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;将xml数据返回微信&quot;&quot;&quot;</span>
        returnXml <span class="token operator">=</span> self<span class="token punctuation">.</span>createXml<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> returnXml

<span class="token keyword">class</span> <span class="token class-name">NativeCall_pub</span><span class="token punctuation">(</span>Wxpay_server_pub<span class="token punctuation">)</span><span class="token punctuation">:</span>
    <span class="token triple-quoted-string string">&quot;&quot;&quot;请求商家获取商品信息接口&quot;&quot;&quot;</span>
    
    <span class="token keyword">def</span> <span class="token function">createXml</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;生成接口参数xml&quot;&quot;&quot;</span>
        <span class="token keyword">if</span> self<span class="token punctuation">.</span>returnParameters<span class="token punctuation">[</span><span class="token string">&quot;return_code&quot;</span><span class="token punctuation">]</span> <span class="token operator">==</span> self<span class="token punctuation">.</span>SUCCESS<span class="token punctuation">:</span>
            self<span class="token punctuation">.</span>returnParameters<span class="token punctuation">[</span><span class="token string">&quot;appid&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;APPID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>APPID  <span class="token comment"># 公众账号ID</span>
            self<span class="token punctuation">.</span>returnParameters<span class="token punctuation">[</span><span class="token string">&quot;mch_id&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>info<span class="token punctuation">[</span><span class="token string">&quot;MCHID&quot;</span><span class="token punctuation">]</span> <span class="token keyword">or</span> WxPayConf_pub<span class="token punctuation">.</span>MCHID  <span class="token comment"># 商户号</span>
            self<span class="token punctuation">.</span>returnParameters<span class="token punctuation">[</span><span class="token string">&quot;nonce_str&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>createNoncestr<span class="token punctuation">(</span><span class="token punctuation">)</span>  <span class="token comment"># 随机字符串</span>
            self<span class="token punctuation">.</span>returnParameters<span class="token punctuation">[</span><span class="token string">&quot;sign&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> self<span class="token punctuation">.</span>getSign<span class="token punctuation">(</span>self<span class="token punctuation">.</span>returnParameters<span class="token punctuation">)</span>  <span class="token comment"># 签名</span>
        <span class="token keyword">return</span> self<span class="token punctuation">.</span>arrayToXml<span class="token punctuation">(</span>self<span class="token punctuation">.</span>returnParameters<span class="token punctuation">)</span>
        
    <span class="token keyword">def</span> <span class="token function">getProductId</span><span class="token punctuation">(</span>self<span class="token punctuation">)</span><span class="token punctuation">:</span>
        <span class="token triple-quoted-string string">&quot;&quot;&quot;获取product_id&quot;&quot;&quot;</span>
        product_id <span class="token operator">=</span> self<span class="token punctuation">.</span>data<span class="token punctuation">[</span><span class="token string">&quot;product_id&quot;</span><span class="token punctuation">]</span>
        <span class="token keyword">return</span> product_id
        

<span class="token keyword">if</span> __name__ <span class="token operator">==</span> <span class="token string">&quot;__main__&quot;</span><span class="token punctuation">:</span>
    unifiedOrder <span class="token operator">=</span> UnifiedOrder_pub<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
    order_id <span class="token operator">=</span> <span class="token string">'213123123123123123'</span>
    money_wchart <span class="token operator">=</span> <span class="token builtin">int</span><span class="token punctuation">(</span><span class="token builtin">float</span><span class="token punctuation">(</span><span class="token number">1.2</span><span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token number">100</span><span class="token punctuation">)</span>
    notify_url <span class="token operator">=</span> <span class="token string">'https://me_host/api/v1/callback'</span>
    <span class="token comment"># body 的编码格式最终转换成ISO8859-1</span>
    order_body <span class="token operator">=</span> <span class="token string">'汉字'</span><span class="token punctuation">.</span>encode<span class="token punctuation">(</span><span class="token string">&quot;utf-8&quot;</span><span class="token punctuation">)</span><span class="token punctuation">.</span>decode<span class="token punctuation">(</span><span class="token string">&quot;latin1&quot;</span><span class="token punctuation">)</span>
    unifiedOrder<span class="token punctuation">.</span>setParameter<span class="token punctuation">(</span><span class="token string">&quot;body&quot;</span><span class="token punctuation">,</span> order_body<span class="token punctuation">)</span>  <span class="token comment"># 商品描述</span>
    timeStamp <span class="token operator">=</span> time<span class="token punctuation">.</span>time<span class="token punctuation">(</span><span class="token punctuation">)</span>
    unifiedOrder<span class="token punctuation">.</span>setParameter<span class="token punctuation">(</span><span class="token string">&quot;out_trade_no&quot;</span><span class="token punctuation">,</span> order_id<span class="token punctuation">)</span>  <span class="token comment"># 商户订单号</span>
    unifiedOrder<span class="token punctuation">.</span>setParameter<span class="token punctuation">(</span><span class="token string">&quot;total_fee&quot;</span><span class="token punctuation">,</span> <span class="token builtin">str</span><span class="token punctuation">(</span>money_wchart<span class="token punctuation">)</span><span class="token punctuation">)</span>  <span class="token comment"># 总金额</span>
    unifiedOrder<span class="token punctuation">.</span>setParameter<span class="token punctuation">(</span><span class="token string">&quot;notify_url&quot;</span><span class="token punctuation">,</span> notify_url<span class="token punctuation">)</span>  <span class="token comment"># 通知地址</span>
    unifiedOrder<span class="token punctuation">.</span>setParameter<span class="token punctuation">(</span><span class="token string">&quot;trade_type&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;NATIVE&quot;</span><span class="token punctuation">)</span>  <span class="token comment"># 交易类型</span>
    unifiedOrder<span class="token punctuation">.</span>setParameter<span class="token punctuation">(</span><span class="token string">&quot;attach&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;6666&quot;</span><span class="token punctuation">)</span>  <span class="token comment"># 附件数据，可分辨不同商家(string(127))</span>
    code_url <span class="token operator">=</span> unifiedOrder<span class="token punctuation">.</span>getCode_url<span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span>code_url<span class="token punctuation">)</span>    
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br><span class="line-number">97</span><br><span class="line-number">98</span><br><span class="line-number">99</span><br><span class="line-number">100</span><br><span class="line-number">101</span><br><span class="line-number">102</span><br><span class="line-number">103</span><br><span class="line-number">104</span><br><span class="line-number">105</span><br><span class="line-number">106</span><br><span class="line-number">107</span><br><span class="line-number">108</span><br><span class="line-number">109</span><br><span class="line-number">110</span><br><span class="line-number">111</span><br><span class="line-number">112</span><br><span class="line-number">113</span><br><span class="line-number">114</span><br><span class="line-number">115</span><br><span class="line-number">116</span><br><span class="line-number">117</span><br><span class="line-number">118</span><br><span class="line-number">119</span><br><span class="line-number">120</span><br><span class="line-number">121</span><br><span class="line-number">122</span><br><span class="line-number">123</span><br><span class="line-number">124</span><br><span class="line-number">125</span><br><span class="line-number">126</span><br><span class="line-number">127</span><br><span class="line-number">128</span><br><span class="line-number">129</span><br><span class="line-number">130</span><br><span class="line-number">131</span><br><span class="line-number">132</span><br><span class="line-number">133</span><br><span class="line-number">134</span><br><span class="line-number">135</span><br><span class="line-number">136</span><br><span class="line-number">137</span><br><span class="line-number">138</span><br><span class="line-number">139</span><br><span class="line-number">140</span><br><span class="line-number">141</span><br><span class="line-number">142</span><br><span class="line-number">143</span><br><span class="line-number">144</span><br><span class="line-number">145</span><br><span class="line-number">146</span><br><span class="line-number">147</span><br><span class="line-number">148</span><br><span class="line-number">149</span><br><span class="line-number">150</span><br><span class="line-number">151</span><br><span class="line-number">152</span><br><span class="line-number">153</span><br><span class="line-number">154</span><br><span class="line-number">155</span><br><span class="line-number">156</span><br><span class="line-number">157</span><br><span class="line-number">158</span><br><span class="line-number">159</span><br><span class="line-number">160</span><br><span class="line-number">161</span><br><span class="line-number">162</span><br><span class="line-number">163</span><br><span class="line-number">164</span><br><span class="line-number">165</span><br><span class="line-number">166</span><br><span class="line-number">167</span><br><span class="line-number">168</span><br><span class="line-number">169</span><br><span class="line-number">170</span><br><span class="line-number">171</span><br><span class="line-number">172</span><br><span class="line-number">173</span><br><span class="line-number">174</span><br><span class="line-number">175</span><br><span class="line-number">176</span><br><span class="line-number">177</span><br><span class="line-number">178</span><br><span class="line-number">179</span><br><span class="line-number">180</span><br><span class="line-number">181</span><br><span class="line-number">182</span><br><span class="line-number">183</span><br><span class="line-number">184</span><br><span class="line-number">185</span><br><span class="line-number">186</span><br><span class="line-number">187</span><br><span class="line-number">188</span><br><span class="line-number">189</span><br><span class="line-number">190</span><br><span class="line-number">191</span><br><span class="line-number">192</span><br><span class="line-number">193</span><br><span class="line-number">194</span><br><span class="line-number">195</span><br><span class="line-number">196</span><br><span class="line-number">197</span><br><span class="line-number">198</span><br><span class="line-number">199</span><br><span class="line-number">200</span><br><span class="line-number">201</span><br><span class="line-number">202</span><br><span class="line-number">203</span><br><span class="line-number">204</span><br><span class="line-number">205</span><br><span class="line-number">206</span><br><span class="line-number">207</span><br><span class="line-number">208</span><br><span class="line-number">209</span><br><span class="line-number">210</span><br><span class="line-number">211</span><br><span class="line-number">212</span><br><span class="line-number">213</span><br><span class="line-number">214</span><br><span class="line-number">215</span><br><span class="line-number">216</span><br><span class="line-number">217</span><br><span class="line-number">218</span><br><span class="line-number">219</span><br><span class="line-number">220</span><br><span class="line-number">221</span><br><span class="line-number">222</span><br><span class="line-number">223</span><br><span class="line-number">224</span><br><span class="line-number">225</span><br><span class="line-number">226</span><br><span class="line-number">227</span><br><span class="line-number">228</span><br><span class="line-number">229</span><br><span class="line-number">230</span><br><span class="line-number">231</span><br><span class="line-number">232</span><br><span class="line-number">233</span><br><span class="line-number">234</span><br><span class="line-number">235</span><br><span class="line-number">236</span><br><span class="line-number">237</span><br><span class="line-number">238</span><br><span class="line-number">239</span><br><span class="line-number">240</span><br><span class="line-number">241</span><br><span class="line-number">242</span><br><span class="line-number">243</span><br><span class="line-number">244</span><br><span class="line-number">245</span><br><span class="line-number">246</span><br><span class="line-number">247</span><br><span class="line-number">248</span><br><span class="line-number">249</span><br><span class="line-number">250</span><br><span class="line-number">251</span><br><span class="line-number">252</span><br><span class="line-number">253</span><br><span class="line-number">254</span><br><span class="line-number">255</span><br><span class="line-number">256</span><br><span class="line-number">257</span><br><span class="line-number">258</span><br><span class="line-number">259</span><br><span class="line-number">260</span><br><span class="line-number">261</span><br><span class="line-number">262</span><br><span class="line-number">263</span><br><span class="line-number">264</span><br><span class="line-number">265</span><br><span class="line-number">266</span><br><span class="line-number">267</span><br><span class="line-number">268</span><br><span class="line-number">269</span><br><span class="line-number">270</span><br><span class="line-number">271</span><br><span class="line-number">272</span><br><span class="line-number">273</span><br><span class="line-number">274</span><br><span class="line-number">275</span><br><span class="line-number">276</span><br><span class="line-number">277</span><br><span class="line-number">278</span><br><span class="line-number">279</span><br><span class="line-number">280</span><br><span class="line-number">281</span><br><span class="line-number">282</span><br><span class="line-number">283</span><br><span class="line-number">284</span><br><span class="line-number">285</span><br><span class="line-number">286</span><br><span class="line-number">287</span><br><span class="line-number">288</span><br><span class="line-number">289</span><br><span class="line-number">290</span><br><span class="line-number">291</span><br><span class="line-number">292</span><br><span class="line-number">293</span><br><span class="line-number">294</span><br><span class="line-number">295</span><br><span class="line-number">296</span><br><span class="line-number">297</span><br><span class="line-number">298</span><br><span class="line-number">299</span><br><span class="line-number">300</span><br><span class="line-number">301</span><br><span class="line-number">302</span><br><span class="line-number">303</span><br><span class="line-number">304</span><br><span class="line-number">305</span><br><span class="line-number">306</span><br><span class="line-number">307</span><br><span class="line-number">308</span><br><span class="line-number">309</span><br><span class="line-number">310</span><br><span class="line-number">311</span><br><span class="line-number">312</span><br><span class="line-number">313</span><br><span class="line-number">314</span><br><span class="line-number">315</span><br><span class="line-number">316</span><br><span class="line-number">317</span><br><span class="line-number">318</span><br><span class="line-number">319</span><br><span class="line-number">320</span><br><span class="line-number">321</span><br><span class="line-number">322</span><br><span class="line-number">323</span><br><span class="line-number">324</span><br><span class="line-number">325</span><br><span class="line-number">326</span><br><span class="line-number">327</span><br><span class="line-number">328</span><br><span class="line-number">329</span><br><span class="line-number">330</span><br><span class="line-number">331</span><br><span class="line-number">332</span><br><span class="line-number">333</span><br><span class="line-number">334</span><br><span class="line-number">335</span><br><span class="line-number">336</span><br><span class="line-number">337</span><br><span class="line-number">338</span><br><span class="line-number">339</span><br><span class="line-number">340</span><br><span class="line-number">341</span><br><span class="line-number">342</span><br><span class="line-number">343</span><br><span class="line-number">344</span><br><span class="line-number">345</span><br><span class="line-number">346</span><br><span class="line-number">347</span><br><span class="line-number">348</span><br><span class="line-number">349</span><br><span class="line-number">350</span><br><span class="line-number">351</span><br><span class="line-number">352</span><br><span class="line-number">353</span><br><span class="line-number">354</span><br><span class="line-number">355</span><br><span class="line-number">356</span><br><span class="line-number">357</span><br><span class="line-number">358</span><br><span class="line-number">359</span><br><span class="line-number">360</span><br><span class="line-number">361</span><br><span class="line-number">362</span><br><span class="line-number">363</span><br><span class="line-number">364</span><br><span class="line-number">365</span><br><span class="line-number">366</span><br><span class="line-number">367</span><br><span class="line-number">368</span><br><span class="line-number">369</span><br><span class="line-number">370</span><br><span class="line-number">371</span><br><span class="line-number">372</span><br><span class="line-number">373</span><br><span class="line-number">374</span><br><span class="line-number">375</span><br><span class="line-number">376</span><br><span class="line-number">377</span><br><span class="line-number">378</span><br><span class="line-number">379</span><br><span class="line-number">380</span><br><span class="line-number">381</span><br><span class="line-number">382</span><br><span class="line-number">383</span><br><span class="line-number">384</span><br><span class="line-number">385</span><br><span class="line-number">386</span><br><span class="line-number">387</span><br><span class="line-number">388</span><br><span class="line-number">389</span><br><span class="line-number">390</span><br><span class="line-number">391</span><br><span class="line-number">392</span><br><span class="line-number">393</span><br><span class="line-number">394</span><br><span class="line-number">395</span><br><span class="line-number">396</span><br><span class="line-number">397</span><br><span class="line-number">398</span><br><span class="line-number">399</span><br><span class="line-number">400</span><br><span class="line-number">401</span><br><span class="line-number">402</span><br><span class="line-number">403</span><br><span class="line-number">404</span><br><span class="line-number">405</span><br><span class="line-number">406</span><br><span class="line-number">407</span><br><span class="line-number">408</span><br><span class="line-number">409</span><br><span class="line-number">410</span><br><span class="line-number">411</span><br><span class="line-number">412</span><br><span class="line-number">413</span><br><span class="line-number">414</span><br><span class="line-number">415</span><br><span class="line-number">416</span><br><span class="line-number">417</span><br><span class="line-number">418</span><br><span class="line-number">419</span><br><span class="line-number">420</span><br><span class="line-number">421</span><br><span class="line-number">422</span><br><span class="line-number">423</span><br><span class="line-number">424</span><br><span class="line-number">425</span><br><span class="line-number">426</span><br><span class="line-number">427</span><br><span class="line-number">428</span><br><span class="line-number">429</span><br><span class="line-number">430</span><br><span class="line-number">431</span><br><span class="line-number">432</span><br><span class="line-number">433</span><br><span class="line-number">434</span><br><span class="line-number">435</span><br><span class="line-number">436</span><br><span class="line-number">437</span><br><span class="line-number">438</span><br><span class="line-number">439</span><br><span class="line-number">440</span><br><span class="line-number">441</span><br><span class="line-number">442</span><br><span class="line-number">443</span><br><span class="line-number">444</span><br><span class="line-number">445</span><br><span class="line-number">446</span><br><span class="line-number">447</span><br><span class="line-number">448</span><br><span class="line-number">449</span><br><span class="line-number">450</span><br><span class="line-number">451</span><br><span class="line-number">452</span><br><span class="line-number">453</span><br><span class="line-number">454</span><br><span class="line-number">455</span><br><span class="line-number">456</span><br><span class="line-number">457</span><br><span class="line-number">458</span><br><span class="line-number">459</span><br><span class="line-number">460</span><br><span class="line-number">461</span><br><span class="line-number">462</span><br><span class="line-number">463</span><br><span class="line-number">464</span><br><span class="line-number">465</span><br><span class="line-number">466</span><br><span class="line-number">467</span><br><span class="line-number">468</span><br><span class="line-number">469</span><br><span class="line-number">470</span><br><span class="line-number">471</span><br><span class="line-number">472</span><br><span class="line-number">473</span><br><span class="line-number">474</span><br><span class="line-number">475</span><br><span class="line-number">476</span><br><span class="line-number">477</span><br><span class="line-number">478</span><br><span class="line-number">479</span><br><span class="line-number">480</span><br><span class="line-number">481</span><br><span class="line-number">482</span><br><span class="line-number">483</span><br><span class="line-number">484</span><br><span class="line-number">485</span><br><span class="line-number">486</span><br><span class="line-number">487</span><br><span class="line-number">488</span><br><span class="line-number">489</span><br><span class="line-number">490</span><br><span class="line-number">491</span><br><span class="line-number">492</span><br><span class="line-number">493</span><br><span class="line-number">494</span><br><span class="line-number">495</span><br><span class="line-number">496</span><br><span class="line-number">497</span><br><span class="line-number">498</span><br><span class="line-number">499</span><br><span class="line-number">500</span><br><span class="line-number">501</span><br><span class="line-number">502</span><br><span class="line-number">503</span><br><span class="line-number">504</span><br></div></div></div> <footer class="page-edit" style="display:none;"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">4/16/2021, 6:55:27 PM</span></div></footer> <!----> <!----></main> <!----> <div class="comments-wrapper" data-v-e3b9d544><div class="valine-wrapper"><div id="valine"></div></div></div></div></div></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;background-color:rgba(231, 234, 241,.5);display:none;" data-v-44bd5a18 data-v-44bd5a18><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-44bd5a18><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-44bd5a18></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-44bd5a18></path></svg></div><div data-v-932dc3c2></div></div></div>
    <script src="/assets/js/app.f4a44a18.js" defer></script><script src="/assets/js/3.48232c0c.js" defer></script><script src="/assets/js/1.1ffd113d.js" defer></script><script src="/assets/js/45.fafbd061.js" defer></script>
  </body>
</html>
